package cn.com.yusys.yusp.custManager.service;

import cn.com.yusys.yusp.custManager.domain.OcrmFCiFqScol;
import cn.com.yusys.yusp.custManager.repository.mapper.FlexibleQueryConMapper;
import cn.com.yusys.yusp.commons.mapper.CommonMapper;
import cn.com.yusys.yusp.commons.service.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * @Author: zoie
 * @Description: 灵活查询查询条件
 * @Date: 2021/5/1
 * @Version: 1.0
 */
@Service
public class FlexibleQueryConService extends CommonService{

    @Autowired
    private FlexibleQueryConMapper flexibleQueryConMapper;

    @Override
    protected CommonMapper<?> getMapper() {
        // TODO 自动生成的方法存根
        return this.flexibleQueryConMapper;
    }

    /**
     * 根据节点信息查询条件字段列
     * @param
     * @return
     */
    public List<Map<String, Object>> getSCol(String ssId) {
        List<Map<String, Object>> list = flexibleQueryConMapper.getSCol(ssId);
        return list;
    }

    public Map<String, String> getUuid(String orgCode) {
        String uuid=UUID.randomUUID().toString().replaceAll("-", "");
        Map<String, String> map=this.flexibleQueryConMapper.getUuid(orgCode);
        map.put("uuid", uuid);
        return map;
    }

    public int addByGroup(OcrmFCiFqScol ocrmFCiFqScol) {
        // TODO 自动生成的方法存根
        return insertSelective(getMapper(), ocrmFCiFqScol);
    }
}


